@extends('backend.template.bootstrap')
@section('content')
<div class="m-b-md">
	<h3 class="m-b-none">用户管理（{{ $members->count() }}）</h3>
</div>
<div class="row">
	<div class="col-lg-12">
		<ul class="breadcrumb">
			<li><a href="{{ url('backend') }}"><i class="fa fa-home"></i> 首页</a></li>
			<li class="active">用户管理</li>
		</ul>
	</div>
</div>
<div class="panel panel-default">
	<header class="panel-heading">所有用户</header>
	<div class="panel panel-body">
		<a href="{{ url('/backend/members/create') }}" class="btn btn-primary">添加用户</a>
		<div class="panel-heading">
		</div>
		<table class="table table-striped b-t b-light table-middle">
			<thead>
				<tr>
					<th>头像</th>
					<th>昵称</th>
					<th>手机号</th>
					<th>注册时间</th>
					<th>OP</th>
				</tr>
			</thead>
			<tbody>
				@foreach($members as $member)
				<tr>
					<td><img src="{{ $member->avatarUrl() }}" width="50"></td>
					<td>{{ $member->nickname }}</td>
					<td>{{ $member->cellphone }}</td>
					<td>{{ $member->created_at }}</td>
					<td>
						<a href="{{ url('/backend/members/'.$member->id.'/edit') }}" class="btn btn-sm btn-primary">编辑</a>
						{!! Form::open(array('method' => 'DELETE', 'route' => array('members.destroy', $member->id), 'class' => 'inline')) !!}
							<a class="btn btn-sm btn-danger" href="#" onclick="if(confirm('确定删除吗？')){$(this).parent('form').submit();}">删除</a>
						{!! Form::close() !!} 
					</td>
				</tr>
				@endforeach
			</tbody>
		</table>
	</div>
</div>
@endsection